package com.spancer.contentcenter.test.listener;

import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;

/**
 * author by: mars
 * Date: 2020/10/13 13:14
 * Description:自定义监听器-方式1：
 * > 在META-INF spring.factories 配置: org.springframework.context.ApplicationListener=com.spancer.contentcenter.test.listener.FirstListener
 * > implements ApplicationListener
 *
 */
@Order(1)
public class FirstListener implements ApplicationListener<ApplicationStartedEvent> {

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        System.out.println("first-mss listener...");
    }
}
